import * as md5 from 'md5';

const managerAuthUrl = '/manager/authorization';
const username = 'lucy';
const password = md5('7654321');

const auth = (app) => new Promise<string>((resolve) => {
  app.httpRequest()
    .get(`${managerAuthUrl}?name=${username}&password=${password}`)
    .then((response) => {
      resolve(response.body.mainData.token);
    });
});

export default auth;
